home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!dfdesign.demon.co.uk
- From: Dominic Feeley <dom@dfdesign.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: fflush and Visual C++
- Date: Sat, 23 Mar 96 18:15:01 GMT
- Organization: DF Designs
- Message-ID: <827604901snz@dfdesign.demon.co.uk>
- References: <4idhv5$dnv@news.mhv.net> <314b173b.71056173@nntp.ix.netcom.com> <4ifuuf$fha@solutions.solon.com> <4issod$jkf@newshost.cyberramp.net> <3152d29a.183262006@nntp.ix.netcom.com>
- Reply-To: dom@dfdesign.demon.co.uk
- X-NNTP-Posting-Host: dfdesign.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.30
- X-Mail2News-Path: dfdesign.demon.co.uk
-
- In article <3152d29a.183262006@nntp.ix.netcom.com>
- miker3@ix.netcom.com "Mike Rubenstein" writes:
- > sinan@cyberramp.net (John Noland) wrote:
- > > In article <4ifuuf$fha@solutions.solon.com>, seebs@solutions.solon.com says...> > >
- > > > The first part of this is incorrect. fflush() may flush input buffers.
- > > > It may cause the program to abort. It may do nothing. [ *** SNIP *** ]
- > > Sorry to keep getting myself in trouble, but...
- > > With Micrsoft's Visual C compiler, if the stream is open for input,
- > > fflush() clears the contents of the buffer.
- > Whoops. You are correct. The documentation does say that and looking
- > at the source I now see how this works.
- > Since ANSI says that calling fflush() with an input stream results in
- > undefined behavior (as I and Pete have pointed out), the compler could
- > do anything in this case and be ANSI compliant.
-
- Don't forget that the result of a call to a function that invokes
- undefined behaviour includes the function doing what you expect.
-
- It may not do what you expect, or what it did last time, when you
- re-compile on another platform, or even with a newer release of
- the compiler on the same platform.
-
- Regards,
- Dominic.
-
- --
- Dominic Feeley
-